package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PropertyFacilityMapper;
import com.ruoyi.system.domain.PropertyFacility;
import com.ruoyi.system.service.IPropertyFacilityService;

/**
 * 公共设施档案Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-27
 */
@Service
public class PropertyFacilityServiceImpl implements IPropertyFacilityService 
{
    @Autowired
    private PropertyFacilityMapper propertyFacilityMapper;

    /**
     * 查询公共设施档案
     * 
     * @param facilityId 公共设施档案主键
     * @return 公共设施档案
     */
    @Override
    public PropertyFacility selectPropertyFacilityByFacilityId(Long facilityId)
    {
        return propertyFacilityMapper.selectPropertyFacilityByFacilityId(facilityId);
    }

    /**
     * 查询公共设施档案列表
     * 
     * @param propertyFacility 公共设施档案
     * @return 公共设施档案
     */
    @Override
    public List<PropertyFacility> selectPropertyFacilityList(PropertyFacility propertyFacility)
    {
        return propertyFacilityMapper.selectPropertyFacilityList(propertyFacility);
    }

    /**
     * 新增公共设施档案
     * 
     * @param propertyFacility 公共设施档案
     * @return 结果
     */
    @Override
    public int insertPropertyFacility(PropertyFacility propertyFacility)
    {
        propertyFacility.setCreateTime(DateUtils.getNowDate());
        return propertyFacilityMapper.insertPropertyFacility(propertyFacility);
    }

    /**
     * 修改公共设施档案
     * 
     * @param propertyFacility 公共设施档案
     * @return 结果
     */
    @Override
    public int updatePropertyFacility(PropertyFacility propertyFacility)
    {
        return propertyFacilityMapper.updatePropertyFacility(propertyFacility);
    }

    /**
     * 批量删除公共设施档案
     * 
     * @param facilityIds 需要删除的公共设施档案主键
     * @return 结果
     */
    @Override
    public int deletePropertyFacilityByFacilityIds(Long[] facilityIds)
    {
        return propertyFacilityMapper.deletePropertyFacilityByFacilityIds(facilityIds);
    }

    /**
     * 删除公共设施档案信息
     * 
     * @param facilityId 公共设施档案主键
     * @return 结果
     */
    @Override
    public int deletePropertyFacilityByFacilityId(Long facilityId)
    {
        return propertyFacilityMapper.deletePropertyFacilityByFacilityId(facilityId);
    }
}
